<?php
    define( 'CONTROLLERS','app/controllers/' );
    define( 'VIEWS','app/views/' );
    define( 'MODELS','app/models/' );
    define( 'HELPERS','system/helpers/' );
    define( 'DS', DIRECTORY_SEPARATOR);
	define('ROOT', (realpath(dirname( __FILE__ )) . DS));
	
    require_once('system/system.php');
    require_once('system/controller.php');
   
    require_once realpath(ROOT . ".." . DS . ".." . DS . "config.php");
    
    $root = explode('/', $CFG->wwwroot, 4);
	
    define( 'WWW_APP', '/'.$root[3].'/blocks/oaeditor/' );
    define( 'WWW_ROOT', '/'.$root[3].'/blocks/oaeditor/app/webroot/' );
    define( 'FILES', ROOT.'app'.DS.'webroot'.DS.'files'.DS);
    
    $start = new System();
    $start->run();